package com.mcxx.modules.base.service.read;

import com.mcxx.modules.miniSalvation.family.dao.read.FamilyMemberReadDao;
import com.mcxx.modules.miniSalvation.family.dao.read.SuspendFamilyReadDAO;
import com.mcxx.modules.miniSalvation.family.dto.BatchProtectResultDTO;
import com.mcxx.modules.miniSalvation.family.dto.SuspendFamilyResultDTO;
import com.mcxx.modules.miniSalvation.family.param.BatchProtectParam;
import com.mcxx.modules.miniSalvation.order.entity.SuspendFamilyEntity;
import com.yinhai.ta404.core.restservice.requestbean.PageParam;
import com.yinhai.ta404.core.restservice.resultbean.Page;
import com.yinhai.ta404.core.service.BaseService;
import com.yinhai.ta404.core.transaction.annotation.TaTransactional;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
@TaTransactional
public class SuspendFamilyReadService extends BaseService {
    @Autowired
    private SuspendFamilyReadDAO suspendFamilyReadDAO;
    @Autowired
    private AreaReadService areaReadService;
    @Autowired
    private FamilyMemberReadDao familyMemberReadDao;
    @Autowired
    private AreaHelper areaHelper;


    public Page querySuspendFamilyList(BatchProtectParam param, PageParam pageParam) {
        suspendFamilyReadDAO.beginPager(pageParam);
        List<SuspendFamilyResultDTO> list = suspendFamilyReadDAO.querySuspendFamilyList(param);
        return suspendFamilyReadDAO.endPager(list);
    }


    public Page querySuspendList(BatchProtectParam param, PageParam pageParam) {
        suspendFamilyReadDAO.beginPager(pageParam);
        List<SuspendFamilyResultDTO> list = suspendFamilyReadDAO.querySuspendList(param);
        return suspendFamilyReadDAO.endPager(list);
    }



    public Page<BatchProtectResultDTO> queryZanTingList(BatchProtectParam param, PageParam pageParam) {
        suspendFamilyReadDAO.beginPager(pageParam);
        List<BatchProtectResultDTO> list = familyMemberReadDao.queryZanTingList(param);
         return familyMemberReadDao.endPager(list);
    }


    public List<SuspendFamilyResultDTO> queryById(String []ids) {
        return  suspendFamilyReadDAO.queryById(ids);
    }


    public List<SuspendFamilyResultDTO> querySuspendExcelList(BatchProtectParam param){ return suspendFamilyReadDAO.querySuspendExcelList(param); }


    public SuspendFamilyResultDTO findSuspendContent(String id){
        return suspendFamilyReadDAO.findSuspendContent(id);
    }


    public SuspendFamilyEntity selectBySourceOrderId(String orderId, String state){
        return suspendFamilyReadDAO.selectBySourceOrderId(orderId,state);
    }

    public int selectSuspendFamily(String familyId,String orderId){
        return suspendFamilyReadDAO.selectSuspendFamily(familyId,orderId);
    }
}
